Component({
  data: {
    "selected": 0,
    "color": "#D78B09",
    "selectedColor": "#fff",
    "backgroundColor": "#FECA49",
    "borderStyle": "white",
    list: [{
        "text": "首页",
        "iconPath": "/icons/home-default.png",
        "selectedIconPath": "/icons/home-active.png",
        "pagePath": "/pages/index/index"
      },
      {
        "text": "卡券",
        "iconPath": "/icons/cards-default.png",
        "selectedIconPath": "/icons/cards-active.png",
        "pagePath": "/pages/card/card"
      },
      {
        "text": "我的",
        "iconPath": "/icons/face-default.png",
        "selectedIconPath": "/icons/face-active.png",
        "pagePath": "/pages/profile/profile"
      }
    ]
  },
  attached() {},
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      // 解决闪动问题
      // this.setData({
      //   selected: data.index
      // })
    }
  }
})